<template>
  <div class="error-page">
    <h1>错误 {{ errorCode }}</h1>
    <p>{{ errorMessage }}</p>
    <el-button type="primary" @click="goHome">返回首页</el-button>
  </div>
</template>

<script setup>
import { useRouter, useRoute } from 'vue-router'

const router = useRouter()
const route = useRoute()

const errorCode = route.query.code || '404'
const errorMessage = route.query.message || '页面未找到'

const goHome = () => {
  router.push('/')
}
</script>

<style scoped>
.error-page {
  text-align: center;
  padding: 50px;
}

.error-page h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

.error-page p {
  font-size: 18px;
  margin-bottom: 30px;
}
</style> 